<!DOCTYPE html>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<html>
<!--
Copyright 2006 Google Inc. All Rights Reserved.


-->
<head>
<title>Closure Unit Tests - goog.dom.iframe</title>
<script src="../base.js"></script>
<script>
  goog.require('goog.dom');
  goog.require('goog.dom.iframe');
  goog.require('goog.testing.jsunit');
</script>

</head>
<body>
  <div style="border: 1px solid black; padding: 4px">
    <div>
      Blank Iframe - The below area should be completely white.
    </div>
    <!-- Simple table to measure the exterior size of the iframe. -->
    <table cellpadding="0" cellspacing="0" id="blank-wrapper">
      <tr><td>
        <div id="blank">
        </div>
      </td></tr>
    </table>
  </div>

<script>

  var domHelper = goog.dom.getDomHelper();

  function setUp() {
    goog.dom.$('blank').innerHTML = '';
  }

  function testCreateBlankYieldsIframeWithNoBorderOrPadding() {
    var iframe = goog.dom.iframe.createBlank(domHelper);
    iframe.style.width = '350px';
    iframe.style.height = '250px';
    goog.dom.$('blank').appendChild(iframe);
    assertEquals(
        'Width should be as styled: no extra borders, padding, etc.',
        350, goog.dom.$('blank').offsetWidth);
    assertEquals(
        'Height should be as styled: no extra borders, padding, etc.',
        250, goog.dom.$('blank').offsetHeight);
  }

</script>
</body>
</html>
